package com.qf;

import com.qf.dao.StudentDao;
import com.qf.dao.SubjectDao;
import com.qf.pojo.Student;
import com.qf.pojo.Subject;
import com.qf.utils.MyBatisUtils;
import org.junit.Test;

import java.util.List;


public class test {

    @Test
    public void testQueryAll(){
        StudentDao mapper = MyBatisUtils.getMapper(StudentDao.class);
        List<Student> list = mapper.queryAll();
        for (Student student : list) {
            System.out.println(student);
            System.out.println(student.getSubjects());
        }
    }

    @Test
    public void testQueryAll1(){
        SubjectDao mapper = MyBatisUtils.getMapper(SubjectDao.class);
        List<Subject> subjects = mapper.queryAll();
        for (Subject subject : subjects) {
            System.out.println(subject);
            System.out.println(subject.getStudents());
        }
    }
}
